import { post } from '@/request/http'
import { setMd5} from '@/utils/utils'
import store from '@/store'


//客户管理查询  同客户管理查询接口

//审核客户---参数未补全

export const editTmClientDetailA=({cltName,fctFltId,cltAgmclt,cltVlflag,cltId,
  cltCode,
  cltEgsname,
  cltContact,
  cltCtctel,
  cltAccount,
  cltAddress,
  cltCliCode,
  cltCliAddress,
  cltCliLegalname,
  cltType,
  cltShtname,
  cltPorts,
  cltRegistorno,
  cltCliLegalid,
  cltRemark,
  cltSatue,
  cltSatRemark,})=>{
  return post('/FTKJWLHYPT/base/auditTmClient',{

    Data: {
      Parameters: {
        FTKJWLHYPT: {cltName,fctFltId,cltAgmclt,cltVlflag,cltId,
          cltCode,
          cltEgsname,
          cltContact,
          cltCtctel,
          cltAccount,
          cltAddress,
          cltCliCode,
          cltCliAddress,
          cltCliLegalname,
          cltType,
          cltShtname,
          cltPorts,
          cltRegistorno,
          cltCliLegalid,
          cltRemark,
          cltSatue,
          cltSatRemark,
        }
      }
    }
  })
}

//取消审核客户-----参数 id和审核状态
export const cancelAuditTmClient=({cltId,cltSatue,cltName,fctFltId,cltAgmclt,cltVlflag})=>{
  return post('/FTKJWLHYPT/base/cancelAuditTmClient',{
    Data: {
      Parameters: {
        FTKJWLHYPT: {cltId,cltSatue,cltName,fctFltId,cltAgmclt,cltVlflag,
          cltLstupduser:store.state.user.USR_CODE_DX_H
        }
      }
    }
  })
}

//用户查看
export const getUserToList=({ffuCltId

})=>{
  return post('/FTKJWLHYPT/base/getUserToList',{
    Data: {
      Parameters: {
        FTKJWLHYPT: {ffuCltId  //客户与用户关联id
        },
        Orderbys: {},
        PageIndexs: {
          FTKJWLHYPT: '1'
        },
        PageSizes: {
          FTKJWLHYPT: '1'
        }
      }
    }
  })
}


//客户用户添加
export const addTmUserModel=({
  ffuStatus,
  ffuUserno,
  fctRemark,
  ffuCltId,//客户与用户关联id
  ffuMobile,
  ffuWechat,
  ffuQq,
  ffuSatTime,
  ffuSatue,
  ffuId,
  ffuPassword,
  ffuEmail,
  ffuName,
})=>{
  return post('/FTKJWLHYPT/base/addTmUserModel',{
    Data: {
      Parameters: {
        FTKJWLHYPT: { ffuStatus,
          ffuUserno,
          fctRemark,
          ffuCltId,
          ffuMobile,
          ffuWechat,
          ffuQq,
          ffuSatTime,
          ffuSatue,
          ffuId,
          ffuPassword:setMd5(ffuPassword),
          ffuEmail,
          ffuName,
          ffuSatName:store.state.user.USR_CODE_DX_H
        }
      }
    }
  })
}

//客户用户编辑
export const editUserInfo=({
  ffuStatus,
  ffuUserno,
  fctRemark,
  ffuCltId,
  ffuMobile,
  ffuWechat,
  ffuQq,
  ffuSatTime,
  ffuSatue,
  ffuId,
  ffuPassword,
  ffuEmail,
  ffuName,
})=>{
  return post('/FTKJWLHYPT/base/editUserInfo',{
    Data: {
      Parameters: {
        FTKJWLHYPT: { ffuStatus,
          ffuUserno,
          fctRemark,
          ffuCltId,
          ffuMobile,
          ffuWechat,
          ffuQq,
          ffuSatTime,
          ffuSatue,
          ffuId,
          ffuPassword,
          ffuEmail,
          ffuName,
          ffuSatName:store.state.user.USR_CODE_DX_H
        }
      }
    }
  })
}

//客户用户审核
export const auditUser=({
  ffuStatus,
  ffuUserno,
  fctRemark,
  ffuCltId,
  ffuMobile,
  ffuWechat,
  ffuQq,
  ffuSatTime,
  ffuSatue,
  ffuId,
  ffuPassword,
  ffuEmail,
  ffuName,
})=>{
  return post('/FTKJWLHYPT/base/auditUser',{
    Data: {
      Parameters: {
        FTKJWLHYPT: { ffuStatus,
          ffuUserno,
          fctRemark,
          ffuCltId,
          ffuMobile,
          ffuWechat,
          ffuQq,
          ffuSatTime,
          ffuSatue,
          ffuId,
          ffuPassword,
          ffuEmail,
          ffuName,
          ffuSatName: store.state.user.USR_CODE_DX_H
        }
      }
    }
  })
}

//客户用户取消审核
export const cancelAuditUser=({
  ffuStatus,
  ffuSatue,
  ffuId,
})=>{
  return post('/FTKJWLHYPT/base/cancelAuditUser',{
    Data: {
      Parameters: {
        FTKJWLHYPT: {
          ffuStatus,
          ffuSatue,
          ffuId,//用户id
        }
      }
    }
  })
}

//重置密码
export const reSetUserPwd=(ffuId)=>{
  return post('/FTKJWLHYPT/base/reSetUserPwd',{
    Data: {
      Parameters: {
        FTKJWLHYPT: {
          ffuId//用户id
        }
      }
    }
  })
}
